package com.feiwei


import org.apache.flink.api.scala.ExecutionEnvironment
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.table.api.{EnvironmentSettings, TableEnvironment}
import org.apache.flink.table.api.scala._
object day2_TableApiTestEnv {


  def main(args: Array[String]): Unit = {
    val set=StreamExecutionEnvironment.getExecutionEnvironment

    val tableEnv = StreamTableEnvironment.create(set)



    //1.1 基于老版本的planer的流处理

    val settings=EnvironmentSettings.newInstance()
      .useOldPlanner()
      .inStreamingMode()
      .build()

   val oldStreamTableEnv=StreamTableEnvironment.create(set,settings)


    //基于老版本的批处理
val batchEnv=ExecutionEnvironment.getExecutionEnvironment
    val oldBatchTableEnv = BatchTableEnvironment.create(batchEnv)


    //基于新版本批 流统一的

    val blinksettings: EnvironmentSettings = EnvironmentSettings.newInstance()
      .useBlinkPlanner()
      .inStreamingMode()
      .build()
    val blinkstreamenvironment = StreamTableEnvironment.create(set,blinksettings)


    //基于新版本批 流统一的

    val blinkbatchsettings: EnvironmentSettings = EnvironmentSettings.newInstance()
      .useBlinkPlanner()
      .inBatchMode()
      .build()
    val blinkbatchenvironment = TableEnvironment.create(blinkbatchsettings)



    //链接外部系统，创建表
    //2.1 读取文件

      val filePath="E:\\repository\\company\\myself\\flink-learning\\flink-learning-demo\\src\\main\\resources\\sensor.txt"
  }
}
